package com.flying.function;

import reactor.core.publisher.Flux;
import reactor.util.function.Tuple2;

import java.io.IOException;
import java.util.function.Function;

public class SpringOneEventsDemo {
    public static void main(String[] args) throws IOException {
//        Function<Message<String>, String> uppercase = FunctionLib.uppercase();
//        System.out.println(uppercase.apply(new GenericMessage<>("hello")));

        Function<Flux<Integer>, Tuple2<Flux<String>, Flux<String>>> router = FunctionLib.router();

        Tuple2<Flux<String>, Flux<String>> streams = router.apply(Flux.range(1, 10));
        streams.getT1().subscribe(System.out::println);
        streams.getT2().subscribe(System.out::println);
        System.in.read();
    }
}
